home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 026a / formcode.zip / DOC.TXT < prev    next >
Text File  |  1991-11-03  |  72KB  |  1,772 lines

  1.  
  2. WHAT IS FormCode/Gen? . . . . . . . . .   1
  3.  
  4. COMPATIBILITY:. . . . . . . . . . . . .   1
  5.  
  6. INSTALLATION & SETUP: . . . . . . . . .   2
  7.  
  8. HOW TO USE THIS MANUAL: . . . . . . . .   3
  9.  
  10. WYSIWYG APPLICATIONS: . . . . . . . . .   3
  11.  
  12. DIFFERENCES FROM TYPICAL
  13. WINDOWS APPLICATIONS: . . . . . . . . .   4
  14.  
  15. PRINTING FROM WITHIN WINDOWS: . . . . .   5
  16.  
  17. CODE GENERATION STRATEGY: . . . . . . .   5
  18.      Program Files: . . . . . . . . . .   5
  19.      Understanding the Generated Code:.   6
  20.  
  21. SCREEN LAYOUT:. . . . . . . . . . . . .  11
  22.  
  23. DESIGN UNITS: . . . . . . . . . . . . .  11
  24.  
  25. FORM DESIGN OBJECTS:. . . . . . . . . .  11
  26.  
  27. BASIC DESIGN PROCEDURES:. . . . . . . .  12
  28.      Drawing Objects: . . . . . . . . .  12
  29.      Zooming and Panning: . . . . . . .  13
  30.      Selecting Objects: . . . . . . . .  13
  31.      De-Selecting Objects:. . . . . . .  14
  32.      Moving Objects:. . . . . . . . . .  14
  33.      Stretching Objects:. . . . . . . .  14
  34.      Editing Object Definitions:. . . .  14
  35.  
  36. MENU DESCRIPTIONS:. . . . . . . . . . .  14
  37.      The File Menu: . . . . . . . . . .  15
  38.           New:  15
  39.           Open:  15
  40.           Save:  15
  41.           Save As:  15
  42.           Gen Code:  15
  43.           Check Sheet:  15
  44.           Print:  15
  45.           Page Setup:  15
  46.           Label Setup:  16
  47.           Open DBF:  16
  48.           Memory Left:  16
  49.           Exit:  16
  50.           About:  16
  51.      The Edit Menu: . . . . . . . . . .  16
  52.           Delete:  16
  53.           Cut:  17
  54.           Copy:  17
  55.           Paste:  17
  56.           Move To Back:  17
  57.           Move To Front:  17
  58.           Group:  17
  59.           Un Group:  17
  60.           Toggle Select:  17
  61.      The Alignment Menu:. . . . . . . .  18
  62.           Center on Horz:  18
  63.           Center on Vert:  18
  64.           Snap X to Grid:  18
  65.           Snap Y to Grid:  18
  66.           Mark Align Ref:  18
  67.           Align Left:  18
  68.           Align Top:  18
  69.           Align Right:  18
  70.           Align Bottom:  18
  71.      The Settings Menu: . . . . . . . .  18
  72.           Grid:  19
  73.           Disp Grid:  19
  74.           Disp Crosshair:  19
  75.           Rulers On:  19
  76.           Gravity On:  19
  77.           Show Text Ext:  19
  78.           Hide Images:  19
  79.           Box Defaults:  19
  80.           Line Defaults:  19
  81.           Text Defaults:  19
  82.           Table Defaults:  19
  83.  
  84. DESIGN OBJECT DESCRIPTIONS: . . . . . .  20
  85.      Box Objects: . . . . . . . . . . .  20
  86.           Line Width  20
  87.           Fill Pattern/Shade  20
  88.           Border Type and shadow  20
  89.      Line Objects:. . . . . . . . . . .  20
  90.      Text Objects:. . . . . . . . . . .  20
  91.           Field  21
  92.           Expr  21
  93.           Build...  21
  94.           Font..  21
  95.           Box...  22
  96.           Pattern..  22
  97.           Justification  22
  98.           Margins  22
  99.      Table Objects: . . . . . . . . . .  22
  100.           Table Title  22
  101.           Column Title and Total Rows  22
  102.           Border Type  22
  103.           Define Columns  22
  104.                Column Width (23); Column
  105.                Body Background (23); Edit
  106.                Title, Body, Total (23)
  107.      Check-box Objects: . . . . . . . .  24
  108.      Bitmap Image Objects:. . . . . . .  24
  109. WHAT IS FormCode/Gen?
  110.  
  111.  
  112. FormCode/Gen is a unique piece of software that allows
  113. you to design printed forms and mailing labels in the
  114. powerful graphical environment of Microsoft Windows
  115. and then generates native dBASE code to print these
  116. forms from your favorite database management system
  117. using your data. Windows is not required for printing the
  118. forms, only for designing them. Your forms can contain
  119. text with a variety of fonts, fill shades and patterns,
  120. lines, boxes, background gray-shading and fill patterns,
  121. tables, check-boxes, and bitmap images.
  122.  
  123. FormCode/Gen combines the power of Windows'
  124. graphical, WYSIWYG,  environment for interactively
  125. designing the forms with the powerful data management
  126. capabilities of the dBASE systems for actually printing
  127. them with data. FormCode/Gen has been highly
  128. optimized for printing at high speeds - which is untypical
  129. of most windows applications. Code generated by
  130. FormCode/Gen can print forms with speeds close to the
  131. theoretical printing speed of the printer!
  132.  
  133. The code generated by FormCode/Gen is native dBASE
  134. code so there is no need for any external libraries, etc.
  135. This also allows free distribution of the generated code.
  136. The generated code is highly structured and is divided
  137. into a user and a system section. The system section
  138. contains the actual coordinates of fields, font
  139. information, etc, and can change when modifications to
  140. the forms are made. The user should never modify this
  141. section of the code since the changes will be lost when
  142. the form is modified and code is re-generated. The user
  143. section contains the query commands such as opening
  144. databases, setting relations and filters, initializing and
  145. incrementing variables and record pointers, etc.
  146. FormCode/Gen generates a template for this section of
  147. the program. The user can modify it according to his/her
  148. needs.
  149.  
  150. Designing forms in FormCode/Gen involves the following
  151. steps: Start up the program from Microsoft Windows;
  152. design your form/label using the editing commands;
  153. open any database files that you need and place the
  154. dBASE fields on the form/label; save your file and
  155. generate code; add the necessary commands for setting
  156. up your query to the generated code; run your program
  157. to print the forms you just designed. Note that you can
  158. also print your forms from within Windows while you
  159. are designing them, but these forms will not have actual
  160. data in them.
  161.  
  162.  
  163. COMPATIBILITY:
  164.  
  165.  
  166. The code generated by FormCode/Gen is compatible
  167. with the following systems: dBASE III Plus, dBASE IV,
  168. FoxBASE Plus, FoxPro (both 1.0 & 2.0), Clipper
  169. Summer 87, and Clipper 5.0. Run time justification of
  170. memo fields, however, only works with FoxPro (both
  171. 1.0 & 2.0) and Clipper 5.0.
  172.  
  173. The output is compatible with all HP LaserJet and
  174. compatible printers starting with the LaserJet Series II
  175. and up. For the most part, the output is also compatible
  176. with the older LaserJet model with the exception of
  177. dealing with paper sizes other than the default.
  178.  
  179. The program requires HP LaserJet printer driver version
  180. 3.61 or later for Microsoft Windows for the LaserJet
  181. Series III printers and version 3.3 or later for the
  182. LaserJet Series II and older printers. Though older driver
  183. versions may work they have not been tested. To find
  184. out which version your printer driver is go to the printer-
  185. setup dialog from the Windows Control Panel and then
  186. click on the About button.
  187.  
  188. It is also recommended that you use printer driver for
  189. the same type of printer on your development system as
  190. your destination printer. For example code generated by
  191. using a printer driver for HP LaserJet III should be run
  192. only on Series III printers and not on Series II, etc. Using
  193. a different driver may not always cause problems, but
  194. some font selection codes do get interpreted differently
  195. by the different printer models.
  196.  
  197. FormCode/Gen allows you to use all internal and
  198. cartridge fonts for the LaserJet and compatible printers.
  199. Soft-fonts can also be used. However, soft-fonts, if
  200. used, must be permanent soft-fonts. That is they must
  201. be loaded in the printer before code generated by
  202. FormCode/Gen is run. Usually soft-font software will
  203. modify your AUTOEXEC.BAT file to automatically
  204. download all soft-fonts. FormCode/Gen itself will not
  205. download any soft-fonts.
  206.  
  207.  
  208. INSTALLATION & SETUP:
  209.  
  210.  
  211. To install FormCode/Gen on hard disk C:, create a
  212. subdirectory \FCG on the C: drive and then set this
  213. directory as your current working directory by typing CD
  214. \FCG. Next type:
  215.           A:UNPK_FCG
  216. This will place all FormCode/Gen files in the directory
  217. \FCG.
  218.  
  219. FormCode/Gen needs an extra printer installed from
  220. Windows. This printer must be identical in type to your
  221. default printer and should also have the same cartridges
  222. installed for it as your default printer. Of course, both of
  223. these printers must be HP LaserJet compatible. Also,
  224. the font cartridges installed for these printers must exist
  225. on the final destination printer where the dBASE code
  226. will run to print the forms/labels that you design.
  227.  
  228. To install this extra printer follow these steps: Edit the
  229. WIN.INI file in your Windows directory using a text
  230. editor. Using your favorite text editor or Windows
  231. Notepad, add a line to the [ports] section of this file.
  232. This line should be:
  233.      FCG.TMP=
  234. After you have added this line, save the WIN.INI file and
  235. start up Windows. From the Windows Control Panel
  236. double click on the Printer icon. This will bring up the
  237. Printers dialog box. Click on the Add Printer button and
  238. from the list of printers select the printer that you will
  239. be printing to. Windows will tell you that a driver
  240. already exists for the selected printer. Select the Current
  241. option to tell Windows to use the existing driver. After
  242. installing this new printer, click on the Configure button.
  243. This will bring up the Printers-Configure dialog box.
  244. From the list of ports presented, select FCG.TMP. This
  245. option will only appear in the ports list box if you
  246. modified the WIN.INI file properly as described earlier.
  247. Next click on the Setup button to add any font
  248. cartridges that you will be using. 
  249.  
  250. Make the newly installed printer active from the Printers
  251. dialog box. However, do not select this printer as your
  252. default printer! This completes the installation process.
  253.  
  254. You should now have two printers installed from
  255. Windows. The first one is your default printer that you
  256. previously had installed in Windows. This printer is
  257. connected to the actual physical port that you will be
  258. printing to (e.g LPT1:, COM1:, etc). The second printer
  259. is identical to the default printer in type and font
  260. cartridges and is an active printer, but it is connected to
  261. the pseudo port called FCG.TMP.
  262.  
  263.  
  264. HOW TO USE THIS MANUAL:
  265.  
  266.  
  267. Like most people, we are sure our users hate reading
  268. program documentation and they are justified in doing
  269. so. However, we encourage you to read the following
  270. sections before you use FormCode/Gen. Believe us, this
  271. will save you some grief later on. Important sections to
  272. read: What Is FormCode/Gen, Installation and Setup,
  273. Differences from Typical Windows Applications, Printing
  274. from Within Windows, Code Generation Strategy, and
  275. Bitmap Images (if you will be using bitmaps). The rest
  276. of the manual can be used as a reference. Use it only
  277. when you can't figure something out.
  278.  
  279.  
  280. WYSIWYG APPLICATIONS:
  281.  
  282.  
  283. As you perhaps already know, WYSIWYG is an acronym
  284. for 'What You See Is What You Get'. In WYSIWYG
  285. applications, the results of your efforts displayed on the
  286. CRT screen closely match the final printed results.
  287. Typically this means that fonts, and graphics are
  288. displayed on the CRT screen as they would print on the
  289. printer. Almost all Windows applications including
  290. FormCode/Gen are WYSIWYG applications.
  291.  
  292. Even thought these applications display results that
  293. match the printed output much better than non-
  294. Windows applications, they have their limitations.
  295. Following is a brief discussion of some of these
  296. limitations:
  297.  
  298. The number one source of inaccuracy is fonts. There are
  299. several reasons for this. First of all is the difference in
  300. resolution between your printer (300 dots/inch) and the
  301. display screen (usually under 100 dots/inch). It is simply
  302. impossible to create fonts that are identical. The second
  303. big difference is the source of the font. The font that is
  304. used in Windows to display your text is more than likely
  305. from a different vendor than the font that you will print
  306. with. Windows tries to find the closest display font that
  307. matches the printer font that you select, but in a lot of
  308. cases the font is only remotely similar.
  309.  
  310. Another source of difference in FormCode/Gen arises
  311. from the fact that FormCode/Gen allows you to select
  312. a pattern for the text foreground also. This capability is
  313. built into the Laser Jet and compatible printers.
  314. However, trying to display the exact foreground
  315. patterns in Windows is not possible without sacrificing
  316. a great deal of speed. For this reason, FormCode/Gen
  317. displays the different text foreground patterns by using
  318. a different color for the text foreground.
  319.  
  320. One more source of inaccuracy appears in bitmaps.
  321. Since bitmaps are also designed for the printers'
  322. resolution, displaying them in Windows usually means
  323. shrinking them. This shrinking can often result in images
  324. that look fairly distorted. However, these images will
  325. print OK.
  326.  
  327.  
  328. DIFFERENCES FROM TYPICAL
  329. WINDOWS APPLICATIONS:
  330.  
  331.  
  332. FormCode/Gen works like most Windows applications in
  333. most aspects and also complies to the IBM Common
  334. User Access (CUA) standards. However, since its end
  335. product, the dBASE code, has to run outside of
  336. Windows and still has to produce results that you got
  337. when printing from Windows, FormCode/Gen has to do
  338. a few things differently from most typical Windows
  339. applications.
  340.  
  341. The biggest difference has to do with how you set up
  342. your printer and how you print from Windows.
  343. FormCode/Gen completely bypasses the Windows
  344. device drivers for printing forms from Windows. This
  345. gives us two advantages: The printing speed is orders
  346. of magnitude faster, and the forms print identically from
  347. within Windows or from outside windows (i.e from
  348. dBASE). The disadvantage is that the printer setup is
  349. local to FormCode/Gen and has nothing to do with the
  350. printer setup of Windows, and that you can not use the
  351. print manager when printing from FormCode/Gen.
  352.  
  353. There are a few other differences which are mainly there
  354. because neither Windows nor the IBM CUA specifies
  355. some functions that we believed are important. So we
  356. implemented them. If you don't like things that don't
  357. comply with the CUA spec, just don't use these
  358. features, but we bet you will. 
  359.  
  360. The first one is aborting a stretch or draw operation: In
  361. most Windows applications, if you have started a
  362. stretch or draw operation by pressing the mouse button,
  363. you can not abort it. With FormCode/Gen, you simply
  364. press Esc to abort the operation in the middle. 
  365.  
  366. The second one has to do with the mouse right key. We
  367. use it for de-selecting objects. You can de-select single
  368. objects by right clicking on them, or you can de-select
  369. by area.
  370.  
  371. The third one is that FormCode/Gen allows you to move
  372. the cursor out of the edit window even during
  373. operations such as stretch, draw, or move. This allows
  374. you to use the scroll bars in the middle of a stretch or
  375. draw operation. You could even move or re-size the
  376. window in the middle of such operation. However, you
  377. should refrain from using menu commands while in the
  378. middle of such operations. The primary purpose of this
  379. implementation is to allow the user to use the scroll bars
  380. in the middle of operations. Most windows programs do
  381. not allow you to do this, however, we felt that this
  382. allows greater ease in editing so we implemented it.
  383.  
  384.  
  385. PRINTING FROM WITHIN WINDOWS:
  386.  
  387.  
  388. The forms you design will be destined to printing from
  389. dBASE eventually. Certainly, however, you are going to
  390. want to print them from within Windows in your design
  391. phase. Since FormCode/Gen needs some extra
  392. information that the Windows device drivers do not
  393. provide, you need to make sure that an extra printer is
  394. installed as described in the Installation Section.
  395.  
  396. The other important thing to remember when printing
  397. from Windows is that you can not use the Windows
  398. Print Manager to print from FormCode/Gen in Windows.
  399. The Print Manager must be turned off from the
  400. Windows Control Panel by first clicking on the printer
  401. icon and then un-checking the Use Print Manager check-
  402. box when the printers dialog appears.
  403.  
  404.  
  405. CODE GENERATION STRATEGY:
  406.  
  407.  
  408. Program Files: FormCode/Gen deals with three
  409. different files when generating code: PCLDRV.PRG,
  410. <design>.PRG, and <design>.MPG, where <design>
  411. is the name of your design. 
  412.  
  413. The PCLDRV.PRG file contains the low level printer
  414. driver routines. All generated code makes calls to
  415. procedures in this file. The procedures in this file remain
  416. fixed. Depending upon which option you selected from
  417. the File Menu, Page Setup command, the contents of
  418. this file either get appended to the generated program in
  419. <design>.PRG, or a SET PROCEDURE TO PCLDRV
  420. statement is generated to make these procedures
  421. available to the generated code. Which option works
  422. best for you will be determined by which dBASE system
  423. you are using (dBASE, Fox, Clipper, etc), and how many
  424. designs you deal with, etc.
  425.  
  426. The <design>.MPG file contains the main program.
  427. When you first create a design, select the Generate
  428. Template Main Program option from the Page Setup
  429. dialog (the default). Having this option checked will
  430. make FormCode/Gen generate a template main program.
  431. You can modify this generated template main program
  432. in the <design>.MPG file. However, after you have
  433. made changes, make sure that you un-check the
  434. Generate Template Main Program check-box from the
  435. Page Setup dialog box so that your changes do not get
  436. overwritten. FormCode/Gen can only generate a
  437. template main program. In almost all cases you will have
  438. to modify the generated main program to include code
  439. for opening database files, setting indexes and relations,
  440. and defining the query.
  441.  
  442. FormCode/Gen combines the code contained in the
  443. <design>.MPG file with the generated procedures into
  444. <design>.PRG. This allows you to make any changes
  445. that you may wish to make in the <design>.MPG file.
  446. When code is generated, the contents of
  447. <design>.MPG automatically get included in the
  448. <design>.PRG file thus combining hand written code
  449. with generated code!
  450.  
  451. Understanding the Generated Code:
  452. FormCode/Gen generates several procedures for your
  453. design. The procedures FCGINIT, FCGFIXOBJ, and
  454. FCGVAROBJ are always generated. Other procedures
  455. such as FCGTBROWn and FCGTBENn are generated
  456. only if the design contained any table objects.
  457.  
  458. FCGINIT defines and initializes all global variables. All
  459. global variable names begin with FCG and are therefore
  460. easy to identify and purge using the RELEASE ALL LIKE
  461. FCG* command.
  462.  
  463. FCGFIXOBJ draws all fixed objects in the design. Fixed
  464. objects include lines, boxes, static text, and table
  465. borders, etc. FCGVAROBJ draws the variable objects,
  466. i.e field text and table data. If you selected the Use
  467. Printer Macros check-box from the Page Setup dialog
  468. box, FormCode/Gen
  469. will define and use a printer macro for all objects that
  470. FCGFIXOBJ draws. The procedures FCGFIXOBJ,
  471. FCVAROBJ, FCGTBROWn, etc, all contain low level
  472. information such as sheet coordinates, etc, for your
  473. design. You should never modify these procedures since
  474. your changes will be lost when code is re-generated.
  475.  
  476. If your design contained any table objects,
  477. FormCode/Gen will generate either one or two
  478. procedures for each table, depending on whether the
  479. table had a totals row. These procedures are called
  480. FCGTBRWn, and FCGTBENn where n is a unique
  481. number that FormCode/Gen arbitrarily assigns to each
  482. table. FCGTBRWn prints the specified row of the table
  483. identified by n (e.g FCGTBRW0 is used to print one row
  484. of table 0), and FCGTBENn prints the totals column for
  485. table n. The remaining parts of the table such as the
  486. border and background pattern, etc, are printed from
  487. FCGFIXOBJ along with other fixed objects.
  488.  
  489. These procedures (i.e FCGFIXOBJ, FCGVAROBJ,
  490. FCGTBROWn, etc) themselves, however, are not self
  491. contained. That is, they do not generate the escape
  492. sequences needed to driver your printer. Instead, they
  493. make calls to procedures in the printer driver library file.
  494. The name of the file that contains the library procedures
  495. is PCLDRV.PRG, and it comes on your distribution disk.
  496. The procedures in this file must be accessible to the
  497. calling procedures. FormCode/Gen makes sure that
  498. these procedures are accessible either by generating a
  499. 'SET PROCEDURE TO PCLDRV' in the main program or
  500. by actually copying the contents of PCLDRV.PRG into
  501. the generated code. Which action is taken depends on
  502. whether the Append Procedures From PCLDRV.PRG
  503. check-box in the Page Setup dialog was checked or not.
  504.  
  505. If you un-check the Append Procedures From
  506. PCLDRV.PRG check-box in the Page Setup dialog box,
  507. the generated code will not contain the procedures from
  508. PCLDRV.PRG. Instead a SET PROCEDURE TO PCLDRV
  509. statement will be generated in the main program. This
  510. will make all procedures in the PCLDRV.PRG file
  511. accessible to the main program. However, on some
  512. systems (for example dBASE III Plus, FoxBase Plus, etc)
  513. the procedures FCGFIXOBJ and FCGVAROBJ
  514. themselves will now not be accessible to the main
  515. program. This approach will therefore not work on these
  516. systems.
  517.  
  518. One more important aspect of generated code that you
  519. need to understand is the use of global variables.
  520. FormCode/Gen uses variable and procedure names that
  521. start with the letters FCG. This keeps them separate
  522. from all user variables and procedures. Some of the
  523. variables that the program uses are global variables so
  524. they take up space even when printing is done. A simple
  525. solution for this problem is to delete all variables that
  526. start with FCG using the command: RELEASE ALL LIKE
  527. FCG*, which deletes all memory variables that start
  528. with FCG. This, however, should be done only after all
  529. the printing procedures have been executed.
  530.  
  531. The following example contains a main program as it
  532. was generated by FormCode/Gen followed by a
  533. modified version of the same program. Following the
  534. program is a line by line explanation of the code. (Note:
  535. Some long lines wrap around):
  536.  
  537. 1:   * This is the template main program
  538. 2:   * Upon code generation, it is placed in the
  539. file with the .MPG extension.
  540. 3:   * From there it is included in the .PRG file
  541. along with other generated
  542. 4:   * procedures.
  543. 5:   * You should modify this main program to add
  544. necessary statements for
  545. 6:   * opening databases, initializing and
  546. increment variables, etc. Make all
  547. 7:   * changes to the .MPG File and NOT the .PRG
  548. file. Also, after you have
  549. 8:   * modified the .MPG file, un-check the
  550. "Generate Template Main Program"
  551. 9:   * from the File->PageSetup dialog box. This
  552. will keep the .MPG file from
  553. 10:  * being overwritten by FromCode/Gen
  554.  
  555. 11:  SET TALK OFF
  556. 12:  * Comment out the next line for debugging.
  557. 13:  SET CONSOLE OFF
  558. 14:  SET PROCEDURE TO INV
  559. 15:  DO FCGINIT
  560. 16:  SET PRINT ON
  561. 17:  DO FCGSTART WITH 1, 0, 2, 4, 300
  562. 18:  ?? FCGRSTVAR
  563. 19:
  564. 20:  FCGPAGE = 1
  565. 21:  DO WHILE FCGPAGE <= 1
  566. 22:       DO FCGFIXOBJ
  567. 23:  *    Code for printing table 0.
  568. 24:       FCGTBROW = 0
  569. 25:       DO WHILE FCGTBROW < 6
  570. 26:            DO FCGTBRW0 WITH FCGTBROW
  571. 27:  *         Do all variable assignment, file
  572. pointer movement, etc, here.
  573. 28:            FCGTBROW = FCGTBROW + 1
  574. 29:       ENDDO
  575. 30:  *    Make sure all totals fields are up to
  576. date at this point
  577. 31:       DO FCGTBEN0
  578. 32:       DO FCGVAROBJ
  579. 33:  *    Do all variable re-assignments, file
  580. pointer movements, etc, here.
  581. 34:       ?? chr(12)
  582. 35:       FCGPAGE = FCGPAGE + 1
  583. 36:  ENDDO
  584. 37:  DO FCGEND
  585. 38:  SET PRINT OFF
  586. 39:  SET CONSOLE ON
  587. 40:  RETURN
  588.  
  589. Lines 1- 10: Comments generated by FormCode/Gen.
  590.  
  591. Line 11: Talk must be turned off during printing!
  592.  
  593. Line 13: Setting console to OFF keeps the PCL escape
  594. sequences from being echoed on the screen. However,
  595. it helps to turn this option on while debugging,
  596. otherwise system messages and prompts don't get
  597. displayed either.
  598.  
  599. Line 14: This line makes all procedures in this file
  600. accessible to the main program which is also contained
  601. in this file. This is unnecessary for some systems such
  602. as FoxPro since FoxPro will automatically find any
  603. procedures contained in the same file as the main
  604. program. So for FoxPro you can delete this line.
  605.  
  606. Line 15: FCGINIT initializes all global variables for the
  607. printing routines.
  608.  
  609. Line 16: Directs output to printer.
  610.  
  611. Line 17: Creates the job set-up string by calling
  612. FCGSTART. Parameters passed are number of copies,
  613. orientation (portrait), paper size (letter), paper source
  614. (lower tray), and graphics resolution (300 DPI, currently
  615. unused). The values passed to FCGSTART come from
  616. the settings of the Page Setup dialog but can be
  617. changed at run time. For example, you could prompt the
  618. user for the number of copies and the paper source and
  619. then pass these values to FCGSTART.
  620.  
  621. Line 18: Sends the printer control string created by
  622. FCGSTART to the printer.
  623.  
  624. Lines 20 & 21: Start a dummy loop for printing a
  625. number of pages; in this case one.
  626.  
  627. Line 22: Prints all fixed objects in the design such as
  628. lines, boxes, table borders, etc.
  629.  
  630. Lines 24 & 25: Start a dummy loop for printing a
  631. number of table rows; five in this case.
  632.  
  633. Line 26: Prints all columns in the specified table row.
  634.  
  635. Line 28: Increments the table row counter.
  636.  
  637. Line 29: Ends the table loop.
  638.  
  639. Line 31: Prints the totals row in the table.
  640.  
  641. Line 32: Prints all other field text in the form.
  642.  
  643. Line 34: Send a form feed to the printer.
  644.  
  645. Line 35: Increments the page counter.
  646.  
  647. Line 36: Ends the main loop.
  648.  
  649. Line 37: Sends the job termination command to the
  650. printer setting the printer state back to it's default
  651. value.
  652.  
  653. Lines 38, 39, 40: Clean up and return. You could add
  654. another statement such as RELEASE ALL LIKE FCG* at
  655. this point to free all memory variable created by the
  656. FCGSTART routine.
  657.  
  658. The following lines show a modified version of the code
  659. listed above. This example is typical of the type of
  660. modifications that you will make to the code. In this
  661. example it is assumed that the form was designed using
  662. fields from two related databases, CUSTMERS and
  663. ORDERS. The CUSTMERS database contains customer
  664. information such as name, address, phone number, etc,
  665. and the orders database contains recently taken orders
  666. from these customers. The form was designed using a
  667. table element for printing individual orders for
  668. customers. This design is contained in your distribution
  669. disk in file INV.FCG and INV.MPG. The databases are
  670. also on the distribution disk. The design only uses
  671. courier 10 and 12 point fonts so it should print on most
  672. LaserJet compatible printers without problems. 
  673.  
  674. Following the code is a line by line explanation of the
  675. program.
  676.  
  677. 1:   SET TALK OFF
  678. 2:   SET CONSOLE OFF
  679. 3:   SET PROCEDURE TO INV
  680. 4:   DO FCGINIT
  681. 5:   SET PRINT ON
  682. 6:   DO FCGSTART WITH 1, 0, 2, 4, 300
  683. 7:   ?? FCGRSTVAR
  684.  
  685. 8:   select 1
  686. 9:   use custmers
  687. 10:  set safety off
  688. 11:  index on cust_num to cust_num
  689. 12:  select 2
  690. 13:  use orders
  691. 14:  set relation to cust_num into custmers
  692. 15:
  693. 16:  DO WHILE .not. eof()
  694. 17:       DO FCGFIXOBJ
  695. 18:       FCGTBROW = 0
  696. 19:       mTOTAL = 0
  697. 20:       mCUSTNUM = cust_num
  698. 21:       DO WHILE cust_num = mCUSTNUM
  699. 22:            DO FCGTBRW0 WITH FCGTBROW
  700. 23:            FCGTBROW = FCGTBROW + 1
  701. 24:            mTOTAL = mTOTAL + cost
  702. 25:            skip
  703. 26:       ENDDO
  704. 27:       mAPPREC = "We apraciate our customers!"
  705. 28:       if (mTOTAL > 500)
  706. 29:            mAPPREC = "You are one of our very
  707. special customers!!"
  708. 30:       endif
  709. 31:       if (mTOTAL > 1000)
  710. 32:            mAPPREC = "You are one of our best
  711. customer!!!"
  712. 33:       endif
  713. 34:       DO FCGTBEN0
  714. 35:       skip -1
  715. 36:       DO FCGVAROBJ
  716. 37:       skip
  717. 38:       ?? chr(12)
  718. 39:  ENDDO
  719. 40:  DO FCGEND
  720. 41:  SET PRINT OFF
  721. 42:  SET CONSOLE ON
  722. 43:  RETURN
  723.  
  724. Lines 1 - 7: Remain unchanged from the generated
  725. code.
  726.  
  727. Lines 8 - 11: Opens the CUSTMERS database and
  728. creates the needed index file for this database. The
  729. index is created from scratch in this example to provide
  730. all users an index compatible with their system since
  731. most dBASE systems use their own unique index
  732. structures.
  733.  
  734. Lines 12 - 14: Open the second database and set the
  735. necessary relation.
  736.  
  737. Line 16: Starts the loop for scanning all records in the
  738. orders database.
  739.  
  740. Line 17: Prints all fixed objects in the design such as
  741. lines, boxes, static text, and table borders, etc.
  742.  
  743. Lines 18 - 20: Initialize the memory variables needed for
  744. printing the table.
  745.  
  746. Line 21: Starts the loop for processing all orders
  747. belonging to the same customer.
  748.  
  749. Line 22: Prints all columns in the specified row of table.
  750.  
  751. Line 23: Increments the table row counter.
  752.  
  753. Line 24: Updates the memory variable that keeps track
  754. of the sum of the COST field.
  755.  
  756. Line 25: Moves the record pointer in the ORDERS
  757. database to the next record.
  758.  
  759. Line 26: Ends the loop for printing table rows.
  760.  
  761. Line 27 - 33: Set the value of the memory variable
  762. mAPPREC to a string based on the results of summing
  763. the COST field in the ORDERS database.
  764.  
  765. Line 34: Prints the totals row in the table. The totals
  766. row was designed using the memory variable mTOTAL
  767. which at this point contains the total cost of all orders.
  768.  
  769. Line 35: The record pointer at this point has moved to
  770. orders for the next customer so move it back to the
  771. current customer before printing the rest of the form.
  772.  
  773. Line 36: Prints the rest of the field text in the form. The
  774. customers name, address, etc., and the appreciation
  775. string get printed here.
  776.  
  777. Line 37: Move record pointer to orders for the next
  778. customer.
  779.  
  780. Line 38: Sends a form-feed to the printer.
  781.  
  782. Line 39: Ends the main program loop for printing forms.
  783.  
  784. Line 40: Sends the printer reset command to the printer
  785. resetting the printer to its default state before the job
  786. started.
  787.  
  788. Lines 41 - 43: The normal ending sequencing.
  789.  
  790. The code presented in this section was from a design
  791. that uses a table object to print tabular data. If your
  792. design does not contain the table object, the generated
  793. code will be a lot simpler.
  794.  
  795.  
  796. SCREEN LAYOUT:
  797.  
  798.  
  799. The screen layout for FormCode/Gen is typical of most
  800. Windows applications. The left hand column, starting
  801. from the top, contains icons for the form design objects
  802. described below. Below these icons are the Zoom In and
  803. Full Page buttons. Below these buttons are displayed
  804. the default settings for box, line, and text objects. The
  805. big window in the middle is the edit window. Below the
  806. edit window is a status line that displays the current
  807. cursor position, number of objects currently selected,
  808. and the current grid setting.
  809.  
  810.  
  811. DESIGN UNITS:
  812.  
  813.  
  814. FormCode/Gen uses one hundredth of an inch as its
  815. basic design unit. All widths, etc, entered by the user in
  816. dialog boxes must be in this unit. For example 1/4 of an
  817. inch is entered as 25. Do not enter decimal numbers
  818. such as 1.5 for one and a half inch. One and a half inch
  819. should be entered as 150. However, the program
  820. displays the current cursor position in decimal inches (eg
  821. 1.33, etc) on the status line.
  822.  
  823.  
  824. FORM DESIGN OBJECTS:
  825.  
  826.  
  827. Forms in FormCode/Gen are designed using six basic
  828. design objects. These objects are: Boxes, Lines, Text,
  829. Tables, Check-boxes, and Bitmap Images. A complete
  830. discussion of each object in detail is given later in this
  831. manual. This section briefly describes the objects: 
  832.  
  833. Boxes can make a form look beautiful and help form
  834. groups of related data. The user can specify the type of
  835. border, border thickness, inside fill pattern, and shadow
  836. for boxes. 
  837.  
  838. Lines can be drawn horizontally and vertically, but not
  839. diagonally, and the user can specify the line thickness. 
  840.  
  841. Text can be either static text or a text field (field here
  842. means database field, variable, or expression). The user
  843. can specify the font and foreground pattern/shade for
  844. text. Text can be single line or multi-line. Text is always
  845. enclosed in an enclosing box. If you do not want the
  846. box, simply give it a border width of zero and no fill.
  847. FormCode/Gen allows text to be left, right, center, or
  848. left/right justified. If the text is field text, justification
  849. will be performed at run time since the actual contents
  850. of the text field are not known until run time. Run time
  851. justification, however, takes its toll both in terms of
  852. speed and memory.
  853.  
  854. Check-boxes allow a more user friendly representation
  855. of true/false data. In the current version of
  856. FormCode/Gen, check-boxes are of fixed size. The user
  857. only specifies the logical expression for the check box.
  858. If the logical expression evaluates to a true, the box will
  859. be checked, otherwise it will remain empty.
  860.  
  861. Tables are a very powerful way of allowing you to build
  862. rows and columns of data. A variety of different border
  863. types can be specified - including no border at all.
  864. Tables may or may not have a table title, column titles,
  865. and a totals row. Each table column can have its
  866. different font, background and foreground pattern,
  867. margins, etc. It is also very easy to design tables with
  868. alternating background patterns.
  869.  
  870. The last form design object is a bitmap image.
  871. FormCode/Gen itself is not an image design package. It
  872. is assumed that images will be designed in other
  873. presentation graphics and/or desk-top publishing
  874. packages (such as Micrografx Designer, Aldus
  875. PageMaker, Ventura Publisher, etc) and then imported
  876. into FormCode/Gen. Images can also be obtained from
  877. a variety of scanning devices and their accompanying
  878. software. The only format currently available for
  879. importing bitmap images into FormCode/Gen is the Tag
  880. Image File Format or TIFF. However, since TIFF is so
  881. universally available, this does not pose any serious
  882. restrictions on the user.
  883.  
  884.  
  885. BASIC DESIGN PROCEDURES:
  886.  
  887.  
  888. This section describes the basic editing procedures that
  889. you will use for designing forms. A detailed description
  890. of all the menu commands follows. The basic editing
  891. procedures used in FormCode/Gen are the same as in
  892. other Windows graphics applications. The only features
  893. unique to FormCode/Gen are the aborting of stretch
  894. and/or draw operations using the Esc key and the use of
  895. the right mouse button for de-selecting selected objects
  896. one by one or by area. The following paragraphs briefly
  897. describe the basic editing procedures:
  898.  
  899. Drawing Objects: All of the form design objects
  900. (boxes, lines, text, etc) can be drawn by first clicking on
  901. the corresponding objects' icon in the object window.
  902. This will highlight the current design object by reversing
  903. its video rendition. Now move the cursor to the edit
  904. window and press the mouse left button where you
  905. want one corner of the object. Drag the mouse to where
  906. you want the other corner of the object and release the
  907. left button. This procedure applies consistently to all
  908. design objects including text, tables, and bitmaps.
  909.  
  910. Some objects, such as lines and boxes, are drawn
  911. instantly as you release the mouse button, while others,
  912. such as text and tables, pop up a dialog box to be filled
  913. with information before the object is drawn.
  914.  
  915. Also, some objects, such as tables, de-select their
  916. object icon in the design object window on the top left
  917. side of the screen while others leave it selected allowing
  918. you to continuing drawing more objects of the same
  919. type without clicking on the object icon each time. This
  920. is done to convenience the user. Frequently drawn
  921. objects, such as boxes and lines, leave their icon
  922. selected so more boxes and lines can be drawn quickly.
  923. Infrequently drawn objects, such as tables, de-select
  924. their icons putting the user back in edit mode to
  925. continue editing.
  926.  
  927. To quit the object draw mode and get back to edit
  928. mode, simply click in the space below the form design
  929. objects. When none of the form design objects is
  930. highlighted, you are back in edit mode.
  931.  
  932.  
  933. Zooming and Panning: FormCode/Gen provides two
  934. levels of zoom; full page and zoomed in. For form design
  935. these two levels give enough flexibility to the user. To
  936. change from one zoom mode to the other simply click
  937. on its button. The Full Page button takes effect
  938. immediately and the display is updated as soon as you
  939. press the button. The Zoom In button does not zoom in
  940. immediately. Instead it presents you with a zoom
  941. rectangle as you move the cursor back to the edit
  942. window. Move the zoom rectangle to the objects that
  943. you want to zoom in on and then click the mouse left
  944. button to zoom in.
  945.  
  946. Panning works exactly as it does in all Windows
  947. applications by using the scroll bars next to the edit
  948. window.
  949.  
  950. Selecting Objects: You have two different ways of
  951. selecting objects: A single object can be selected by
  952. clicking the mouse left button when cursor is on the
  953. object. If the shift key is pressed while clicking on the
  954. object, other objects that were already selected remain
  955. selected and the new object is also selected, otherwise
  956. previously selected objects are de-selected. Several
  957. objects can be selected together by moving the cursor
  958. to one corner of the window, pressing the left button,
  959. and then moving the cursor to the other corner while
  960. keeping the left button pressed. As the left button is
  961. released, all objects that fall completely inside the
  962. stretch box will be selected and everything outside the
  963. box will be de-selected.
  964.  
  965. You may encounter difficulty selecting objects some
  966. times. This is especially true when you have overlapping
  967. objects and/or smaller objects that are completely inside
  968. larger objects. The object in front gets selected when
  969. you may be trying to select the object behind it. Simply
  970. click again without moving the mouse to select the
  971. object behind. If you have several overlapping objects,
  972. keep clicking without moving the mouse and each
  973. object will be selected in sequence till you reach the last
  974. object under the cursor. Another solution is to make
  975. some large objects unselectable by editing their
  976. definition. This will keep them completely out of your
  977. way while editing. You could also use the Edit Menu,
  978. Move to Back command to move the larger object
  979. behind the smaller object and out of the way.
  980.  
  981. De-Selecting Objects: De-selecting works identically
  982. to selecting except that you use the right mouse button
  983. instead of the left. An Individual object can be de-
  984. selected by clicking on the object, or several objects at
  985. a time can be de-selected by using the area de-select
  986. operation.
  987.  
  988. Moving Objects: Objects can be moved one at a
  989. time, or several objects can be moved together. To
  990. move a single object, de-select everything else and then
  991. press the mouse left button after moving the cursor on
  992. top of the object that you wish to move. The object can
  993. be dragged by moving the mouse while the button
  994. remains pressed. The move is completed by releasing
  995. the button or aborted by pressing Esc.
  996.  
  997. Several objects can be moved together by first selecting
  998. the objects that you want to move and then pressing
  999. the mouse left button on any one of these objects. Drag
  1000. the objects to the desired position while keeping the
  1001. button pressed.
  1002.  
  1003. Stretching Objects: Objects can be stretched in any
  1004. direction by first moving the cursor to the corner of the
  1005. selected object where stretching is to take place. When
  1006. cursor is in its proper stretch position, the cursor shape
  1007. will change. Press the mouse left button and stretch the
  1008. object while keeping the button pressed. Release the
  1009. button to complete the stretch operation, or press Esc
  1010. to abort.
  1011.  
  1012. Objects can be stretched within legal limits only. In
  1013. particular, you can not stretch objects to a size smaller
  1014. than possible for the object. The smallest possible size
  1015. is determined by the type of object that you are
  1016. stretching. For example, for a text object, the smallest
  1017. size is determined by the actual text string, the size of
  1018. the font, the number of lines of text, and the margins.
  1019.  
  1020. Editing Object Definitions: You can edit the
  1021. definition of form objects by double clicking on the
  1022. object with the mouse left button. This will bring up a
  1023. dialog box for editing the objects definition. Some
  1024. objects, bitmap images for example, have no definition
  1025. that can be edited. Double clicking on these objects will
  1026. do nothing.
  1027.  
  1028.  
  1029. MENU DESCRIPTIONS:
  1030.  
  1031.  
  1032. Following is a description of all menu commands
  1033. available in FormCode/Gen. There are four pull-down
  1034. menus that the program uses namely, File, Edit,
  1035. Alignment, and Settings.
  1036.  
  1037. The File Menu: The File Menu has the following
  1038. commands:
  1039.  
  1040. New: Clears the previous design and starts a new form
  1041. or label design. The user is prompted for the type of
  1042. design, either form or label.
  1043.  
  1044. Open: Opens a previously saved design. FormCode/Gen
  1045. files have an extension of .FCG. The open dialog works
  1046. just like any Windows open file dialog box.
  1047.  
  1048. Save: Saves the current design in file. If the design has
  1049. not yet been given a name, the user is prompted to
  1050. enter a name for the design.
  1051.  
  1052. Save As: Saves the current design under a different file
  1053. name.
  1054.  
  1055. Gen Code: Generates dBASE code for the current
  1056. design. This is the end result of FormCode/Gen. The
  1057. generated code is placed in a file that has the same
  1058. name as the design itself and has an extension of .PRG.
  1059. If the design contained any bitmap images, a separate
  1060. file is generated for each image. These files have the
  1061. same names as the TIFF files that were read in, but they
  1062. have an extension of .PCL since they contain PCL
  1063. commands to print the image. These files must be
  1064. distributed along with the .PRG file. Also, the image
  1065. files are placed in the same directory where the design
  1066. file is saved even if the original TIFF files were opened
  1067. from different directories. This allows convenient
  1068. distribution of the image files.
  1069.  
  1070. Also, before you can generate code, you must have an
  1071. additional printer identical to your default printer
  1072. installed from Windows. This printer should be
  1073. connected to FCG.TMP from the ports selection menu.
  1074. For more information on this, read the section on
  1075. Installation and Setup.
  1076.  
  1077. Check Sheet: Checks the design for design error such as
  1078. objects that are outside the sheet boundaries. If such
  1079. objects are reported by FormCode/Gen, the Toggle
  1080. Select command can be used to select and delete these
  1081. objects.
  1082.  
  1083. Print: Prints the current design to the default Windows
  1084. printer. The default printer can be changed from the
  1085. Windows Control Panel. You must disable the Windows
  1086. Print Manager while printing from FormCode/Gen. Also,
  1087. you must have an additional printer identical to your
  1088. default printer installed from Windows. This printer
  1089. should be connected to the FCG.TMP pseudo port from
  1090. the ports selection menu. For more information on
  1091. these, read the section on Installation and Setup.
  1092.  
  1093. Even though the default printer is set from the Windows
  1094. Control Panel (and must be set before starting
  1095. FormCode/Gen), the program ignores all other settings
  1096. of the default printer such as paper source, orientation,
  1097. etc. These settings are obtained from the page setup
  1098. inside FormCode/Gen. The page setup menu is explained
  1099. below.
  1100.  
  1101. Page Setup: This menu has all the options that apply to
  1102. the overall design, such as paper size and bin,
  1103. orientation, number of copies, etc. FormCode/Gen saves
  1104. all of these settings in the design file along with all other
  1105. design data. These settings take precedence over the
  1106. printer setup that is set from the Windows Control
  1107. Panel.
  1108.  
  1109. Selecting the Use Printer Macros option will cause
  1110. FormCode/Gen to generate code that defines and uses
  1111. printer macros for all fixed objects (lines, boxes, bit-
  1112. maps, etc) in the design. Choosing this option can
  1113. significantly increase printing speed, especially if your
  1114. printer is connected to a slow serial port. However, this
  1115. speed is gained at the expense of printer memory. If
  1116. your printer does not have enough memory, using this
  1117. option may result in printer errors.
  1118.  
  1119. Checking the Generate Template Main Program will
  1120. make FormCode/Gen generate a new template main
  1121. program for your design upon code generation. This
  1122. template main program is first placed in the file
  1123. <design>.MPG and then from there it is also included
  1124. in the <design>.PRG file, where <design> is the
  1125. name of your design file. Normally, you will select this
  1126. option after first creating a design to generate a
  1127. template main program. You would then modify the
  1128. template program in <design>.MPG and also un-check
  1129. the Generate Template Main Program option to keep
  1130. your modifications from being overwritten by
  1131. FormCode/Gen.
  1132.  
  1133. The Append Procedures From PCLDRV.PRG option tells
  1134. FormCode/Gen whether or not to append printer driver
  1135. routines from the driver library file into the generated
  1136. code. If this option is un-checked, the procedures are
  1137. not physically copied from the driver file but instead a
  1138. SET PROCEDURE TO PCLDRV statement is generated
  1139. making these procedures accessible to the generated
  1140. routines. This produces smaller code, however, it will
  1141. only work for some dBASE systems (for example
  1142. FoxPro) and not for others (for example FoxBASE Plus).
  1143.  
  1144. Label Setup: This menu sets all label parameters if the
  1145. design is a label. If the design is a form rather than a
  1146. label, this menu command remains disabled.
  1147.  
  1148. Open DBF: You can open up-to 50 database files at a
  1149. time for placing fields in your design. If any databases
  1150. are open, the Build... button in text and table dialogs is
  1151. enabled. This allows you to select fields from the
  1152. databases to build text and table expressions.
  1153.  
  1154. Memory Left: Displays the amount of memory currently
  1155. available to Windows. This memory, however, can be
  1156. used by other applications running concurrently also. If
  1157. the amount of memory is low (below 300K) you may
  1158. want to consider closing some of the other applications.
  1159.  
  1160. Exit: terminates the program after prompting the user to
  1161. save any unsaved edits.
  1162.  
  1163. About: Displays copyright and version information for
  1164. FormCode/Gen.
  1165.  
  1166. The Edit Menu: The Edit Menu has the following
  1167. commands:
  1168.  
  1169. Delete: Deletes all selected objects. The objects are not
  1170. placed on the clipboard, and are lost forever.
  1171.  
  1172. Cut: Copies all selected objects from the design to the
  1173. clipboard and deletes them from the design. Note that
  1174. FormCode/Gen uses a private clipboard rather the
  1175. Windows global clipboard. This is because the data from
  1176. FormCode/Gen is not in any of the formats that most
  1177. Windows applications can understand, so it would be
  1178. pretty worthless to place the data on the Windows
  1179. clipboard.
  1180.  
  1181. Copy: Copies all selected objects from the design to the
  1182. clipboard without affecting the design. Note that
  1183. FormCode/Gen uses a private clipboard rather the
  1184. Windows global clipboard. This is because the data from
  1185. FormCode/Gen is not in any of the formats that most
  1186. Windows applications can understand, so it would be
  1187. pretty worthless to place the data on the Windows
  1188. clipboard.
  1189.  
  1190. To copy objects from one design to another, simply use
  1191. the copy command to copy the selected objects to the
  1192. clipboard. Then open the new design file and paste from
  1193. the clipboard.
  1194.  
  1195. Paste: Pastes objects from the local clipboard into the
  1196. current design. Objects are placed on the clipboard
  1197. using the Cut or Copy command. Objects are placed at
  1198. a slight displacement from their original position, i.e the
  1199. position they were at before cutting or copying, in the
  1200. design.
  1201.  
  1202. Move To Back: Moves the currently selected object
  1203. behind all other design objects. All other objects retain
  1204. their relative positions with respect to each other. As
  1205. new objects are placed in the design, they are placed on
  1206. top of existing objects. This command may be
  1207. necessary to change this default order.
  1208.  
  1209. Move To Front: Moves the currently selected object in
  1210. front of all other design objects. All other objects retain
  1211. their relative positions with respect to each other. As
  1212. new objects are placed in the design, they are placed on
  1213. top of existing objects. This command may be
  1214. necessary to change this default order.
  1215.  
  1216. Group: Objects can be made part of a group of objects.
  1217. When an object that belongs to a group is selected, all
  1218. other objects in that group are also selected. To group
  1219. several objects together, first select them, and then use
  1220. the group command. If any of the selected objects
  1221. belonged to another group previously, they loose their
  1222. membership in the old group.
  1223.  
  1224. Un Group: Removes all selected objects from their
  1225. groups, if any.
  1226.  
  1227. Toggle Select: Selects all objects that are currently not
  1228. selected, and de-selects all objects that are currently
  1229. selected. This command can be very useful for selecting
  1230. objects that get outside the sheet boundaries and
  1231. become out of sight. For example to select all design
  1232. objects that are outside the sheet boundary and thus
  1233. out of sight, first select all objects inside the sheet
  1234. boundary by using the area select command over the
  1235. entire sheet, and then use this command to select all
  1236. objects that are outside the sheet limits.
  1237.  
  1238. The Alignment Menu: The Alignment Menu has the
  1239. following commands:
  1240.  
  1241. Center on Horz: This command works differently
  1242. depending on how many objects are selected. If only
  1243. one object is selected, it will be centered horizontally on
  1244. the page. If two or more objects are selected, the
  1245. smaller objects will be centered horizontally inside the
  1246. largest object. The position of the largest object remains
  1247. unchanged.
  1248.  
  1249. Center on Vert: This command works differently
  1250. depending on how many objects are selected. If only
  1251. one object is selected, it will be centered vertically on
  1252. the page. If two or more objects are selected, the
  1253. smaller objects will be centered vertically inside the
  1254. largest object. The position of the largest object remains
  1255. unchanged.
  1256.  
  1257. Snap X to Grid: Snaps the left and right sides of all
  1258. selected objects to the nearest grid point. The top and
  1259. bottom sides remain unchanged.
  1260.  
  1261. Snap Y to Grid: Snaps the top and bottom sides of all
  1262. selected objects to the nearest grid point. The left and
  1263. right sides remain unchanged.
  1264.  
  1265. Mark Align Ref: Marks the currently selected object as
  1266. a reference point for alignment. The actual alignment is
  1267. performed using the Align Left/Top/Right/Bottom
  1268. commands explained below.
  1269.  
  1270. Align Left: This command works in conjunction with the
  1271. Mark Align Ref command. The Mark Align Ref command
  1272. is used to mark one object as a reference point. This
  1273. command, when followed by the Mark Align Ref
  1274. command performs the actual alignment by aligning all
  1275. currently selected objects to the left side of the
  1276. reference object.
  1277.  
  1278. Align Top: This command works in conjunction with the
  1279. Mark Align Ref command. The Mark Align Ref command
  1280. is used to mark one object as a reference point. This
  1281. command, when followed by the Mark Align Ref
  1282. command performs the actual alignment by aligning all
  1283. currently selected objects to the top side of the
  1284. reference object.
  1285.  
  1286. Align Right: This command works in conjunction with
  1287. the Mark Align Ref command. The Mark Align Ref
  1288. command is used to mark one object as a reference
  1289. point. This command, when followed by the Mark Align
  1290. Ref command performs the actual alignment by aligning
  1291. all currently selected objects to the right side of the
  1292. reference object.
  1293.  
  1294. Align Bottom: This command works in conjunction with
  1295. the Mark Align Ref command. The Mark Align Ref
  1296. command is used to mark one object as a reference
  1297. point. This command, when followed by the Mark Align
  1298. Ref command performs the actual alignment by aligning
  1299. all currently selected objects to the bottom side of the
  1300. reference object.
  1301.  
  1302.  
  1303. The Settings Menu: The settings menu allows the
  1304. user to change all system settings and editing
  1305. preferences. All of these settings are stored in the
  1306. design file along with other design objects and restored
  1307. when a design file is opened. The Settings Menu has
  1308. the following commands.
  1309.  
  1310. Grid: Sets the horizontal and verticle grid. Grid units are
  1311. specified in hundredths of inches, so for example a half
  1312. inch grid is specified as 50 points. All edit and draw
  1313. operations snap to the nearest grid point. Even though
  1314. the cursor moves smoothly between grid points, the
  1315. coordinate display on the status line is in multiples of
  1316. the grid units.
  1317.  
  1318. Disp Grid: Turns on/off the displaying of the current
  1319. grid. Remember that objects snap to the current grid
  1320. setting regardless of whether the grid display is turned
  1321. on or off.
  1322.  
  1323. Disp Crosshair: Turns on/off the crosshair across the
  1324. edit window.
  1325.  
  1326. Rulers On: Turns on/off the rulers displayed on top of
  1327. and to the left side of the edit window.
  1328.  
  1329. Gravity On: When gravity is turned on, the cursor tends
  1330. to pull itself to grid points as if it were being attracted
  1331. to the grid points. When gravity is turned off the cursor
  1332. moves smoothly between grid points and can stop in
  1333. the middle of grid points. Gravity has no affect on how
  1334. drawing or editing actually works, it is simply a
  1335. preference on how the cursor behaves.
  1336.  
  1337. Show Text Ext: As explained in the section on What
  1338. You See is What You Get or WYSIWYG, FormCode/Gen
  1339. displays your design on the screen as accurately as
  1340. possible. However it is not always possible to find a
  1341. screen font that exactly matches the printer font being
  1342. requested and Windows uses the best match it can find.
  1343. On many occasions, this font will be significantly
  1344. different from the printer font in both size and style.
  1345. This is specially true, when dealing with unusual or very
  1346. small typefaces.
  1347.  
  1348. This commands turns on/off the display of the actual
  1349. extent of all text as it will be printed. The extent are
  1350. displayed by drawing blue color rectangles in the exact
  1351. positions where the text will appear when printed to the
  1352. printer.
  1353.  
  1354. Hide Images: Bitmap images are slow to draw, and can
  1355. significantly slow down editing speed. This command
  1356. turns on/off the display of all bitmap images. When
  1357. images are hidden, they are replaced with blue
  1358. rectangles that show their position but are much faster
  1359. to draw.
  1360.  
  1361. Box Defaults: Sets the defaults for box objects. All new
  1362. boxes are drawn using these settings. The new settings
  1363. are displayed in the status window in the lower left
  1364. corner of the display.
  1365.  
  1366. Line Defaults: Sets the defaults for line objects. All new
  1367. lines are drawn using these settings. The new settings
  1368. are displayed in the status window in the lower left
  1369. corner of the display.
  1370.  
  1371. Text Defaults: Sets the defaults for text objects. All
  1372. new text is drawn using these settings. The new
  1373. settings are displayed in the status window in the lower
  1374. left corner of the display.
  1375.  
  1376. Table Defaults: Sets the defaults for table objects. All
  1377. new tables are drawn using these settings.
  1378.  
  1379.  
  1380. DESIGN OBJECT DESCRIPTIONS:
  1381.  
  1382. FormCode/Gen provides the user with six basic design
  1383. objects for designing forms and labels. These objects
  1384. are Boxes, Lines, Text, Check-boxes, Tables, and
  1385. Bitmap Images. The following paragraphs describe all of
  1386. these objects in greater detail:
  1387.  
  1388. Box Objects: The use of boxes can dramatically
  1389. improve the appearance of any printed form. Boxes can
  1390. be used to group items together by placing them inside
  1391. boxes and also to contain other objects such as text and
  1392. bitmap images.
  1393.  
  1394. The user can specify the following parameters for
  1395. boxes: 
  1396.  
  1397. Line Width: Specify line width in hundredths of inches.
  1398. For example enter 10 for one tenth of an inch. If no line
  1399. is desired, for example a box with shading only and no
  1400. border, enter a width of 0 (It would be pretty
  1401. meaningless to have a box with both no border and no
  1402. fill)
  1403.  
  1404. Fill Pattern/Shade: Boxes can have a fill pattern or gray
  1405. shade to fill the interior of the box. Select the fill by
  1406. using the scroll bar on the fill selector in the Edit Box
  1407. Definition dialog box. It is important to note that a fill of
  1408. White is not the same as a fill of none. A white fill
  1409. overwrites any objects under the box, whereas with a
  1410. fill of none, objects underneath the box remain visible.
  1411.  
  1412. Border Type and shadow: Boxes can have either a single
  1413. border or a double border and a shadow can be
  1414. specified for boxes.
  1415.  
  1416. Line Objects: In the present version of FormCode/Gen
  1417. lines can only be either horizontal or verticle. This is
  1418. because these are the only types of lines that can be
  1419. drawn on all HP Laser Printers before the Laser Jet III
  1420. without sacrificing speed. Since forms usually only have
  1421. horizontal or verticle lines, however, this should not
  1422. pose any serious problems.
  1423.  
  1424. The only parameter that the user specifies for lines is
  1425. the lines width. Specify the width in hundredths of
  1426. inches (e.g one tenth of an inch is 10 units).
  1427.  
  1428. Text Objects: FormCode/Gen provides a great deal of
  1429. flexibility in drawing text. All text is enclosed in an
  1430. enclosing box whose definition can be edited by the
  1431. user. If an enclosing box is not desired, simply give it a
  1432. width of 0 and a fill pattern of white or none.
  1433.  
  1434. Text is divided into two main categories: Field Text and
  1435. Static Text. Static text appears in your forms exactly as
  1436. it appears on the screen or as it is printed from
  1437. Windows. That is, the contents of the text object
  1438. remain the same. Field text on the other hand can be a
  1439. database field, variable, or any other expression that
  1440. evaluates to a character value in dBASE. Numeric, date,
  1441. and logical values must be converted to character.
  1442.  
  1443. Static text can be single line or multi-line. To enter
  1444. multiple lines of text, press Ctrl-Enter at the end of each
  1445. text line (simply entering Enter will close the dialog box).
  1446. As many lines of text as desired can be entered. The
  1447. selected justification applies to all entered lines.
  1448.  
  1449. Field text can also be single line or multi-line. However,
  1450. only the L/R justification, which justifies both left and
  1451. right, can be used with multi-line field text. The actual
  1452. number of lines in multi-line field text can only be
  1453. determined at run time, therefore the user should leave
  1454. enough room to fit the longest possible text. Multi-line
  1455. field text is extremely useful for printing memo fields in
  1456. FoxPro (1.0 and 2.0) and Clipper 5.0. Simply draw a
  1457. box large enough to contain the text, select L/R
  1458. justification and other options as desired, and enter the
  1459. name of a memo field as the text expression. That's all
  1460. there is to printing beautiful left and right justified text
  1461. that is automatically filled line by line from your memo
  1462. field! FormCode/Gen does run time filling and
  1463. justification.
  1464.  
  1465. The Edit Text Definition dialog box provides the user
  1466. with two separate edit boxes for entering text. The top
  1467. box is titled Enter Display Text:. In this box enter the
  1468. text as you would like Windows to display it while
  1469. editing. If the text object is static text then the display
  1470. text is also the actual contents of the text object. If,
  1471. however, the text object is field text, the display text is
  1472. only used to display the text from Windows, and also
  1473. for printing the form from within Windows. In this case
  1474. you may want to put some meaningful text as the
  1475. display text. For example, you can put your name where
  1476. a name database field appears.
  1477.  
  1478. Also, in the case of field text, the actual length of the
  1479. text remains unknown until it is printed from dBASE
  1480. using your data. Therefore make sure you leave enough
  1481. room to account for the longest possible values.
  1482. Another thing to keep in mind is that the extent of the
  1483. text can not simply be calculated based on the number
  1484. of characters since with proportional fonts different
  1485. characters have significantly different width.
  1486.  
  1487. Following is a description of other items in the Edit Text
  1488. Definition dialog box:
  1489.  
  1490. Field: Mark the check box to indicate that the text is
  1491. field text rather than static text. As long as the check
  1492. box is un-marked, you will not be able to enter anything
  1493. in the expression edit box.
  1494.  
  1495. Expr: If the Field check box is checked signifying field
  1496. text, this edit box can be used to enter the field
  1497. expression. The field expression must be a valid dBASE
  1498. expression and must evaluate to character type. The
  1499. Build.. button can be used to help build field
  1500. expressions.
  1501.  
  1502. Build...: This push button will be enabled if the text is
  1503. field text and any database files have been opened from
  1504. the File Menu. Click on the button to retrieve fields from
  1505. open database files to build the field expression.
  1506.  
  1507. Font..: Click on this push button to select the font for
  1508. the text. The list of fonts presented contains all the
  1509. fonts that have been installed from Windows. Select the
  1510. desired typeface, size, and style (bold and/or italic).
  1511.  
  1512. Box...: Click on this button to edit the definition of the
  1513. enclosing box for the text object. The Edit Box
  1514. Definition dialog appears. Editing box definition for text
  1515. boxes is identical to editing box definition for stand
  1516. alone boxes which is described above.
  1517.  
  1518. Pattern..: Click on this button to specify a foreground
  1519. pattern for the text object. The Edit Text Pattern dialog
  1520. box appears to allow you to select a pattern for drawing
  1521. the text.
  1522.  
  1523. Justification: Select the desired justification from Left,
  1524. Right, Center, or L/R. The justification is with respect to
  1525. the enclosing box, even if the box is not visible.
  1526.  
  1527. Margins: Specify the left, top, right, and bottom margins
  1528. in hundredths of inches (e.g 1/10 inch specified as 10).
  1529. Again, the margins are with respect to the enclosing
  1530. box. Text justification is performed inside the margins.
  1531.  
  1532. Table Objects: Tables provide a very convenient and
  1533. powerful way of presenting tabular data, i.e data that
  1534. falls in rows and columns. FormCode/Gen provides a
  1535. great deal of flexibility in the design of tables: Tables
  1536. can have single or double border, and for single border
  1537. the width for all the lines can be specified individually.
  1538. Tables may or may not have a title, and table columns
  1539. may or may not have a title and a total. Each column
  1540. can have its own font, background, margins,
  1541. justification etc. The following is a detailed description
  1542. of the table object:
  1543.  
  1544. A table is defined in terms of these items from the Edit
  1545. Table Definition dialog:
  1546.  
  1547. Table Title: A table may or may not have a title. Check
  1548. the Table Has Title check box to determine whether the
  1549. table has a title. If the check box is checked, the Edit
  1550. Title... button can be used to edit the title definition.
  1551.  
  1552. Column Title and Total Rows: The table may or may not
  1553. have a column titles row and a column totals row.
  1554. Check the desired check-boxes. The selections you
  1555. make will determine how the Edit Table Column dialog
  1556. box is presented.
  1557.  
  1558. Border Type: Select either a single or a double border. If
  1559. a single border is selected, you can define the widths of
  1560. individual lines that define the border. To do this click
  1561. the Define... button. All widths are entered in
  1562. hundredths of inches (e.g 1/10 of an inch is entered as
  1563. 10).
  1564.  
  1565. Define Columns: Click on the various buttons in this
  1566. group box to edit the definitions of individual table
  1567. columns. At the top of the box are displayed the total
  1568. number of columns in the table and the current column.
  1569. The current column is the one whose definition is edited
  1570. by clicking on the Edit... button. You can insert and
  1571. delete columns at any position desired. Columns are
  1572. numbered starting at 0.
  1573.  
  1574. When the Edit Table Definition dialog first pops up, the
  1575. current column field will say All. This means that when
  1576. you click on the Edit... button you are editing column
  1577. definition for all columns. This is very useful for defining
  1578. common characteristics to all columns, such as font,
  1579. background, widths, etc. After the common
  1580. characteristics have been set for all columns, the
  1581. individual column definitions can be edited individual to
  1582. modify their unique characteristics.
  1583.  
  1584. Each table column is defined in terms of several things
  1585. such as width, background, and cell. These items are
  1586. defined from the Edit Table Column dialog which
  1587. appears when you edit a column. The following is a
  1588. more detailed description of items in this dialog box:
  1589.  
  1590. Column Width: Columns can have an absolute or
  1591. relative width. If absolute width is selected, the width
  1592. value is specified in hundredths of an inch. Absolute
  1593. width fixes the width of the specified column to the
  1594. entered value. Stretching the table will have no effect
  1595. on the width of absolute width columns, only relative
  1596. width columns will stretch.
  1597.  
  1598. For relative width columns, the value is interpreted as a
  1599. relative number. This can be looked at as a percent
  1600. number if the sum of all relative width columns is 100,
  1601. but it does not have to be a percent number. For
  1602. example, if the sum of all relative width columns adds
  1603. up to 300, then the widths of individual columns will
  1604. not be a percent value.
  1605.  
  1606. When the user stretches a table object, either when
  1607. creating a new table or when stretching an existing one,
  1608. FormCode/Gen calculates column widths as follows:
  1609. First all absolute columns are assigned their absolute
  1610. width, then the remainder amount is distributed over all
  1611. of the relative width columns proportionately by their
  1612. relative widths. If a table does not have any relative
  1613. width columns, it can not be stretched in the horizontal
  1614. direction. It has a fixed horizontal size. The minimum
  1615. verticle size of a table row is determined by the text
  1616. font being used, and the margins, etc.
  1617.  
  1618. Column Body Background: You can select a pattern and
  1619. or gray shade for each columns background. This
  1620. background can be applied to all rows in the column,
  1621. only the odd rows, only the even rows, or no rows at
  1622. all. This odd/even/none/all selection applies only to the
  1623. body of the that column. The actual pattern can be
  1624. select by using the Edit Body... button.
  1625.  
  1626. If columns have titles and totals, specified from the Edit
  1627. Table Definition dialog, the backgrounds of these titles
  1628. and totals remain unaffected by the odd/even/none/all
  1629. selection. This selection only applies to the body part of
  1630. the column.
  1631.  
  1632. Edit Title, Body, Total: These push buttons allow you to
  1633. edit the title, body, or totals cell for a table column. The
  1634. title, and total buttons will be enabled only if table has
  1635. column titles and totals. These cells define the text font
  1636. to be used, the justification for the text, the margins,
  1637. the text foreground pattern, and the cell background
  1638. pattern.
  1639.  
  1640. For the title cell the entered text is treated as static text,
  1641. i.e it appears literally in the printed form. For the body
  1642. and totals cells, the text is treated as a text expression.
  1643. The expression could be a database field, variable, or
  1644. any other valid dBASE expression that evaluates to a
  1645. character value. Expressions that do not evaluate to
  1646. character values, such as numeric, date or logical, must
  1647. be converted to character type.
  1648.  
  1649. When a table is printed from Windows, its cells contain
  1650. the cell numbers for text. The actual text will be
  1651. displayed when the table is printed from dBASE.
  1652.  
  1653. Check-box Objects: Check boxes provide a more
  1654. attractive way of presenting logical data. The user
  1655. specifies an expression for each check-box. This
  1656. expression can be a database field, memory variable, or
  1657. any other valid dBASE expression that evaluates to a
  1658. logical value. If the expression evaluates to a true value,
  1659. a check-mark is placed inside the check-box. Otherwise
  1660. the check-box remains empty.
  1661.  
  1662. When printed from Windows, check-boxes are always
  1663. printed with a check-mark in them since the logical
  1664. expression can not yet be evaluated.
  1665.  
  1666. Bitmap Image Objects: Bitmap images can be
  1667. included in forms designed with FormCode/Gen.
  1668. However, this software itself is not meant to be a
  1669. graphics image design package so no image editing is
  1670. possible. Images can be edited with other graphics/desk-
  1671. top publishing packages and then brought into
  1672. FormCode/Gen. Images can also be obtained from a
  1673. variety of scanners. Typically the images brought into a
  1674. design will be logos, etc.
  1675.  
  1676. Upon code generation, FormCode/Gen creates a
  1677. separate file with a .PCL extension for each imported
  1678. image in the design. This file contains the pre-processed
  1679. image and must be distributed along with the .PRG file
  1680. generated.
  1681.  
  1682. The user needs to understands a few things about
  1683. images before using this feature. Some of this
  1684. knowledge will help you in selecting proper options
  1685. when options when generating images from your
  1686. imaging software.
  1687.  
  1688. Images can be brought into designs by reading Tag
  1689. Image Format files or TIFF files. At present, this is the
  1690. only format that FormCode/Gen can understand.
  1691. However, TIFF is such a universal format that this does
  1692. not put any serious limitations on the variety of images
  1693. that can be brought in. FormCode/Gen supports the full
  1694. class B of TIFF files. In particular, this means that it is
  1695. capable of reading monochrome images and allows
  1696. unpacked as well as compressed images using Pack Bits
  1697. and CCITT 1D compression schemes.
  1698.  
  1699. When generating TIFF files from scanner or imaging
  1700. software two things must be taken into consideration:
  1701. The resolution of the image and half-toning. Both of
  1702. these are described in greater detail in the following
  1703. paragraphs:
  1704.  
  1705. Most imaging and scanner software packages can
  1706. produce TIFF images with a variety of resolutions. For
  1707. scanners the resolution typically is 75, 150, or 300 dots
  1708. per inch. All of these are acceptable resolution values
  1709. for HP Laser Jet and compatible printers and
  1710. FormCode/Gen will accept any of them without any
  1711. problems. The higher the resolution, the better the
  1712. quality of the image will be, but at the same time the
  1713. larger the image file size will be and the slower to print
  1714. the image will be.
  1715.  
  1716. Most imaging and graphics packages will also give you
  1717. an option for specifying image resolution. If your
  1718. package allows you to select from printer or screen
  1719. resolution, select printer resolution. Images written at
  1720. screen resolution may not print very well, and will
  1721. certainly not be of the right size.
  1722.  
  1723. Another factor to consider for images is half-toning or
  1724. dithering. Both of these are methods of simulating
  1725. shades of gray on printers that can only print black
  1726. dots. Imaging packages and scanner software can take
  1727. an image that was originally designed with or scanned
  1728. from a colored or true gray scale image and write it to
  1729. a TIFF file as a monochrome image by performing half-
  1730. toning or dithering on it. FormCode/Gen itself does
  1731. neither dithering nor half-toning of images. So this step
  1732. must be performed at the source. Some imaging
  1733. packages will only let you specify the type of TIFF file
  1734. as Monochrome, Color, or Gray-scale. If you were
  1735. exporting (i.e generating a TIFF file) for a colored or
  1736. gray-scale image and specified monochrome as the
  1737. output type, most of the good packages will
  1738. automatically do half-toning or dithering before writing
  1739. the image out as a monochrome bitmap.
  1740.  
  1741. FormCode/Gen prints images from dBASE by sending a
  1742. pre-processed version of the image (contained in a file
  1743. with the .PCL extension) directly to the printer. The
  1744. reason for using this approach is that dBASE does not
  1745. have any other means for sending binary data to the
  1746. printer without intervening with the data. In the supplied
  1747. printer driver library, the file is copied to the printer
  1748. using the DOS copy command in procedure FCGIMAGE.
  1749. The /b switch is used to keep DOS from interpreting the
  1750. data as an ASCII file and must be specified. The copy
  1751. command copies the file to the DOS PRN device. By
  1752. default DOS treats PRN as LPT1. If your printer is not
  1753. connected to LPT1, you can either change the copy
  1754. command or use the DOS MODE LPT1=XX command
  1755. in your AUTOEXEC.BAT file to redirect all output from
  1756. the PRN device to the true physical device that your
  1757. printer is connected to (e.g COM1). You must edit the
  1758. FCGIMAGE procedure in the PCLDRV.PRG file to reflect
  1759. the port that your printer is connected to. On systems
  1760. other than DOS, such as Novel, Unix, etc, you will
  1761. probably need to change the copy command itself also
  1762. not just the printer port. For example in Unix the
  1763. command may look like: cp pict.pcl /dev/prn.
  1764.  
  1765.  
  1766.  
  1767. The following are registered trade marks of their
  1768. respective owners: dBASE (Ashton Tate Corp.),
  1769. FoxPlus/FoxPro (Fox Software Inc.), Clipper (Nantucket
  1770. Corp.), LaserJet (Hewlett Packard Corp.), Aldus
  1771. PageMaker (Aldus Corp), Novel (Novel Inc.), Unix (AT&T
  1772. Corp.).